<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../start/layui/css/layui.css">
    <script src="../start/layui/layui.js"></script>
</head>
<body>
    <div id="test1"></div>
  <script src="../src/layui.js"></script>
  <script>
  layui.use('tree', function(){
    var tree = layui.tree;
   
    //渲染
    var inst1 = tree.render({
      elem: '#test1'  //绑定元素
      ,showCheckbox:true//开启复选框
      ,edit:true//开启编辑图标
      ,accordion:true//开启手风琴效果
      ,data: [{
        title: '江西' //一级菜单
        ,children: [{
          title: '南昌' //二级菜单
          ,children: [{
            title: '高新区' //三级菜单
            //…… //以此类推，可无限层级
          }]
        }]
      },{
        title: '陕西' //一级菜单
        ,children: [{
          title: '西安' //二级菜单
        }]
      },{title:'河南'
      ,children:[{
          title:'郑州'
      }]
    }]
    });
  });
  </script>
</body>
</html>